package com.sss.hloster06;

public class SyncThread implements Runnable {
	private int tid;
	private Object lock;

	public SyncThread(int id, Object obj) {
		this.tid = id;
		this.lock = obj;
	}

	public void run() {
		synchronized (lock) {
			for (int i = 0; i < 10; i++) {
				System.out.println("线程 ID 名称为：：" + this.tid + "   正在输出： " + i);
			}
		}
	}
}